﻿
@{
    ViewBag.Title = "分类清单-住院病人";
    Layout = "~/Views/Shared/_Form.cshtml";
}

<div class="rows">
    <div class="panel panel-default">
        <table class="form">
            <tr>
                <th class="formTitle">住院号：</th>
                <td class="formValue">
                    <input id="zyh" name="zyh" type="text" class="form-control" />
                </td>
                <th class="formTitle"></th>
                <td class="formValue" style="padding-left:20px;">
                    <input type="button" id="btn_search" onclick="submit();" class="btn btn-primary btn-md" value="查询" style="width:55px" />
                </td>
                <th></th>
                <td></td>
                <th></th>
                <td></td>
                <th></th>
                <td></td>
            </tr>
        </table>
    </div>
</div>

<div class="ui-layout" id="layout" style="height:100%;width:100%;">
    <iframe class="ui-layout-center" style="width:100%;" id="iframerightiframerightiframerightttt" name="iframerightiframerightiframerightttt"
            scrolling="auto" allowtransparency="true" frameborder="0"></iframe>
</div>

<script type="text/javascript">
    var reportServerHOST = '@(ViewBag.ReportServerHOST)';
    var orgId = '@(ViewBag.OrgId)';
    var isHospAdministrator = '@(ViewBag.IsHospAdministrator)';
    var curUserCode = '@(ViewBag.CurUserCode)';

    var uri = 'ReportServer/Pages/ReportViewer.aspx?%2fHIS.Report.1%2f%E5%88%86%E7%B1%BB%E6%B8%85%E5%8D%95.%E4%BD%8F%E9%99%A2%E7%97%85%E4%BA%BA&rs:Command=Render';

    function submit() {

        if ($('#zyh').val().length == 0) {
            $.modalAlert("缺少住院号" , "error");
            return;
        }

        var url = getUrl();

        url += "&zyh=" + $('#zyh').val();

        setTimeout("$.loading(true, '正在请求报表页面...');", 10);
        $("#iframerightiframerightiframerightttt").attr('src', url);
    }

    $("#iframerightiframerightiframerightttt").load(function () {
        $.loading(false);
    });

    $(function () {
        var h = $(window).height() - 55
        $('#layout iframe').css('height', h);
    });

    function getUrl() {
        var srcUrl = uri;
        srcUrl = reportServerHOST + srcUrl;
        //获取自定义样式
        if (true) {
            if (srcUrl.indexOf('&rc:Stylesheet') == -1) {
                srcUrl += "&rc:Stylesheet=MyStyleSheet";
            }
        } 

        //获取自定义样式
        if (true) {
            if (srcUrl.indexOf('&rc:Stylesheet') == -1) {
                srcUrl += "&rc:Stylesheet=MyStyleSheet";
            }
        } 

        if (true) {
            if (srcUrl.indexOf('&rs:') == -1) {
                srcUrl += "&rs:";
            }
            else {
                srcUrl += "&";
            }
            srcUrl += "orgId=";
            srcUrl += orgId;
        }

        if (false) {
            if (srcUrl.indexOf('&rs:') == -1) {
                srcUrl += "&rs:";
            }
            else {
                srcUrl += "&";
            }
            srcUrl += "curUserCode=";
            srcUrl += curUserCode;
        }

        if (false) {
            if (srcUrl.indexOf('&rs:') == -1) {
                srcUrl += "&rs:";
            }
            else {
                srcUrl += "&";
            }
            srcUrl += "isHospAdministrator=";
            srcUrl += isHospAdministrator;
        }

        return srcUrl;
    }

</script>
